package promote.brozen.swagger.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import promote.brozen.swagger.domains.model.SomeModel;
import promote.brozen.swagger.domains.vo.SomeVo;

/**
 * @author Brozen
 * @date 2020/11/3 16:09
 * @email brozen@qq.com
 */
@Api(tags = "是一个controller")
@RestController
public class SomeController {

    @ApiOperation(value = "是一个接口", notes = "别忘了说你是谁")
    @GetMapping("/hello")
    public ResponseEntity<String> hello(@ApiParam(name = "你的名字") String name) {
        return new ResponseEntity<>("你好啊，" + name, HttpStatus.OK);
    }

    @ApiOperation(value = "给我一个model，给你一个vo", tags = "这个标签是什么")
    @PostMapping("/info")
    public ResponseEntity<SomeVo> info(@RequestBody SomeModel model) {
        return new ResponseEntity<>(new SomeVo().setId(model.getUuid()), HttpStatus.OK);
    }


}
